<?php
	class UserHandler {
			
		private $m_dbConnection = NULL;
		private $m_userTableName = "user";
		
		
        public function __construct(DBConnection $a_connection, $tablePrefix) {
        	$this->m_dbConnection = $a_connection;
        	$this->m_userTableName = $tablePrefix . $this->m_userTableName;
		}
		
		/*
         * CREATE TABLE  `login_user` (
`userId` INT NOT NULL AUTO_INCREMENT,
`email` VARCHAR( 50 ) NOT NULL ,
`firstName` VARCHAR( 30 ) NOT NULL ,
`lastName` VARCHAR( 30 ) NOT NULL ,
`dateOfBirth` VARCHAR( 11 ) NOT NULL ,
`password` VARCHAR( 30 ) NOT NULL ,
PRIMARY KEY (  `userId` ) ,
INDEX (  `email`, `password` )
) ENGINE = MYISAM ;
         * 
         */
        
		//Hämtar en användare
        public function GetUser($email, $password) {
                                
            $sql = "SELECT id FROM $this->m_userTableName WHERE email = ? and password = ?";
            
            $stmt = $this->m_dbConnection->Prepare($sql);
			
			$stmt->bind_param("ss", $email, $password);
			
        }
		
        private function RunAndFetchObjects(mysqli_stmt $a_stmt) {
                return $this->m_dbConnection->RunAndFetchObjects($a_stmt, "User", "id");
        }
	}
?>